<template>
  <el-row>
    <el-row>
      <el-col :span="16" :offset="1">
        <div>
          <span style="font-size: 16px;margin-right: 10px;color: #1f2f3d;">{{title}}</span>
          <span>发布日期：{{showDate}}</span>
        </div>
        <div style="padding: 10px 0;color: #5e6d82;font-size: 14px">{{text}}</div>
      </el-col>
      <el-col :span="5" style="text-align: right;">
        <el-button type="text" @click="showEvent" icon="el-icon-edit">查看</el-button>
        <el-button type="text" @click="deleteEvent" icon="el-icon-delete">删除</el-button>
      </el-col>
    </el-row>
    <Divider></Divider>
  </el-row>
</template>

<script>
import moment from "moment";

export default {
  name: "FootCardItem",
  props: {
    title: {
      type: String,
      default: "无标题"
    },
    date: {
      type: String,
      default: ""
    },
    text: { 
      type: String,
      default: "无内容"
    },
    deleteEvent: {
      type: Function,
      default: function() {}
    },
    showEvent: {
      type: Function,
      default: function() {}
    }
  },
  computed: {
    showDate() {
      return moment(this.date).format(`YYYY-MM-DD`);
    }
  }
};
</script>
